{% extends "dynamic/base.html" %}

{% load i18n adminmedia djangoplus %}

{% block stylesheet %}{% admin_media_prefix %}css/dashboard.css{% endblock %}
{% block bodyclass %}dashboard{% endblock %}
{% block coltype %}colMS{% endblock %}

{% block extrahead %}{{ block.super }}

<style>
    .repository_info {
        margin-top: 10px;
        margin-bottom: 10px;
    }
</style>
{% endblock extrahead %}

{% block content %}
<div id="content-main">

    {% comment %} AVAILABLE REPOSITORIES {% endcomment %}
    {% if availables|length|is_gt:1 %}
    <div class="repository_info">
        <strong>{% trans "Available Repositories" %}:</strong>
        
        {% for rep in availables %}
        {% ifequal rep.0 current_repository %}<strong>{% endifequal %}
        <a href="?choose_repository={{ rep.0 }}">{{ rep.0 }}</a>
        {% ifequal rep.0 current_repository %}</strong>{% endifequal %}
        {% endfor %}

        <br/>
        
        <strong>{% trans "Current Repository" %}:</strong>
        {{ current_path }}
    </div>
    {% endif %}

    {% comment %} REPOSITORY FUNCTIONS {% endcomment %}
    {% if current_repository %}
    <div class="module">
        <table width="100%">
            <caption>{% trans "Current repository" %}</caption>
            {% for file in files %}
            <tr>
                <td>
                    {{ file }}
                </td>
                <td width="1">
                    &nbsp;
                </td>
            </tr>
            {% endfor %}
        </table>

        <div style="padding: 5px; text-align: right">
            <input type="submit" name="update" value="{% trans "Commit/Push" %}"/>
            <input type="submit" name="update" value="{% trans "Update" %}"/>

            <table width="100%" cellpadding="0" cellspacing="0">
                <tr>
                    <td width="99%"><input name="cmd" style="width: 100%"/></td>
                    <td width="1%">&nbsp;<input type="submit" value="{% trans "Manual command line" %}"/></td>
                </tr>
            </table>
        </div>
    </div>
    {% endif %}
</div>
{% endblock content %}

